<?php
use Phalcon\Di;
$searchEngine = Di::getDefault()->get('config')->cache('searchEngine');
$options = [];
foreach ($searchEngine as $key => $value){
    $options[$key] = $value['name'];
}
return [
    '_id' => 'searchSettings',
    '_form' => [
        'method' => 'post',
        'class' => [],
        'accept-charset' => 'utf-8',
        'role' => 'form',
        'ajax-submit' => '#main',
        'id' => 'searchSettings',
    ],
    'defaultEngine' => [
        'widget' => 'Select',
        'isLabel' => true,
        'access' => [
            'addForm' => true,
            'editForm' => true,
        ],
        'options' => $options,
        'addition' => true,
        'label' => '默认搜索引擎',
        'description' => '在搜索组件没有指定搜索引擎时默认使用的搜索引擎',
        'error' => '',
        'attributes' => [
            'class' => 'form-control',
        ],
    ],
    '_options' => [
        'storage' => 'm.search.config',
        'module' => 'Search',
        'title' => '设置',
        'description' => '搜索相关设置',
    ],
];
